import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/apps/shop/Layout/Layout.vue'
Vue.use(Router)
const routerInstance = new Router({
  routes: [
    {
      path: '/',
      meta: {},
      component: Layout,
      children: [
        {
          path: '',
          name: 'ShopHome',
          meta: {},
          components: {
            default: () => import('@/apps/shop/views/Home.vue')
          }
        },
        {
          path: 'list',
          name: 'ShopList',
          props: true,
          meta: {},
          components: {
            default: () => import('@/apps/shop/views/List.vue')
          }
        },
        {
          path: 'detail/:id',
          name: 'ShopDetail',
          props: { default: true },
          meta: {},
          components: {
            default: () => import('@/apps/shop/views/Detail.vue')
          }
        }
      ]
    },
    {
      path: '/yuedu',
      component: () => import('@/apps/shop/views/YueDu.vue')
    },
    {
      path: '/wenchuang',
      component: () => import('@/apps/shop/views/WenChuang.vue')
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    // return 期望滚动到哪个的位置
    return { x: 0, y: 0 }
  }
})
export default routerInstance
